package com.sneakxy.cloudbase.platform.service;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.sneakxy.cloudbase.platform.bean.dto.PermissionDTO;
import com.sneakxy.cloudbase.platform.utils.web.Response;

@FeignClient(name="security-producer", path = "/security/api/permission")
public interface PermissionClient {
	
	@PostMapping("one")
	public Response<PermissionDTO> one(@RequestParam(name="id") String id);
	
	@PostMapping("tree")
	public Response<List<PermissionDTO>> tree();
	
	@PostMapping("add")
	public Response<PermissionDTO> add(@SpringQueryMap PermissionDTO perm);
	
	@PostMapping("validate")
	public Response<Boolean> validate(@RequestParam(name="id") String id);
	
	@PostMapping("edit")
	public Response<PermissionDTO> edit(@SpringQueryMap PermissionDTO perm);
	
	@PostMapping("remove")
	public Response<Integer> remove(@RequestParam(name="id") String id);
	
	@PostMapping("permissions")
	public Response<List<String>> permissions(@RequestParam(name="roles") List<String> roles);
	
}
